UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zSazaoZymoy9JTAo+7ylPbElSN3bmeqa4blicFXhQgo='
WHERE
key_id = '59d026a95a7220262d4d1ac648e894f20cbd6ced0c7dfd7953a52af6d90d573d'
AND (
token = 'zSazaoZymoy9JTAo+7ylPbElSN3bmeqa4blicFXhQgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)