UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XHaJ7+UR/wKOP7tVOclSlDHkjU6Tjiw+c13uyzdKvfE='
WHERE
key_id = '485341a3fed4016677c76fc59e98e0277817d98240f9701d6418fb81e135642c'
AND (
token = 'XHaJ7+UR/wKOP7tVOclSlDHkjU6Tjiw+c13uyzdKvfE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)