UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b6B6BKXIkxiKuncsFQ9Pnvifj1mGTdaw5xPwNRXEw74='
WHERE
key_id = '70ed066f69667e5c790bfafc6d1ae50a8de9c1aac363dd40f095bb4e3abba8af'
AND (
token = 'b6B6BKXIkxiKuncsFQ9Pnvifj1mGTdaw5xPwNRXEw74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)