UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0rLVA1JikR/mYkVgXWfucsIihZvnagqeZrZjb5RjMJI='
WHERE
key_id = 'f9680896ac69507e124bd1eebd8c2160ca8b5a4c3e3cf6ed82c7dc764ca7f68f'
AND (
token = '0rLVA1JikR/mYkVgXWfucsIihZvnagqeZrZjb5RjMJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)