UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dr2V2DgOJNzO8NlSumm6pUOXg9AHX8U3bzZ7D81xudc='
WHERE
key_id = 'c2bcc2ccb9dfca870d6db996b38bb0a0eea4a96ee04ee2bfb57005ea3721a320'
AND (
token = 'Dr2V2DgOJNzO8NlSumm6pUOXg9AHX8U3bzZ7D81xudc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)