UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ryvzAuPv4VSg3tKZw+Tc7G79NZjsH7ovEMexCW3Vhvw='
WHERE
key_id = '8a388e1511107d28cf8330b3db490ae3fadbecc4597c9b8e5898663690679317'
AND (
token = 'ryvzAuPv4VSg3tKZw+Tc7G79NZjsH7ovEMexCW3Vhvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)