UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5AbYLNQuMeFKqKHgKl1XqhIB2t4CwYzX70N3yp0eX7Q='
WHERE
key_id = '037968f7e09fbf7db3e2626cf35732b04111a8be5fc8169848db691225d31f0b'
AND (
token = '5AbYLNQuMeFKqKHgKl1XqhIB2t4CwYzX70N3yp0eX7Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)