UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jFvNvqveNrllv5nZAPTkTixdelwjrYw1OHMQ/iaThu4='
WHERE
key_id = '9bca568a63160392d5ef29da00b6032ddb3873ebd7429af71fe7858ec85f8e7a'
AND (
token = 'jFvNvqveNrllv5nZAPTkTixdelwjrYw1OHMQ/iaThu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)