UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2AO7tEVF8o1qsM+GDGfA2deRfQyk54VUFQEWe0XJQmw='
WHERE
key_id = 'a85c92bc9985acd8b86ef05ef5a20688ab94e32ec8e1aa3daaa26d728c7781d1'
AND (
token = '2AO7tEVF8o1qsM+GDGfA2deRfQyk54VUFQEWe0XJQmw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)