UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ykhYsYkUjCYxLEA7080iSRVbt4ghnRKTggJ4QRIz/J8='
WHERE
key_id = 'affc77ad681a40afafc131a4a8fb50b6be22b4e4f0a36726c1f6700dbb2b3d98'
AND (
token = 'ykhYsYkUjCYxLEA7080iSRVbt4ghnRKTggJ4QRIz/J8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)