UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oJsQLjoXrJtn8pC0g7In2JobMswjCq9TVA7V9cr93VE='
WHERE
key_id = '63fa4ad09e5066dd78654c3ea06b37219d76e2944d8808dc628a5c86aa2b4d1b'
AND (
token = 'oJsQLjoXrJtn8pC0g7In2JobMswjCq9TVA7V9cr93VE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)