UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'euGXGoX7/58isZ8FLGYQY8jwFeLs5GKSMoZqsVPpEjo='
WHERE
key_id = 'ad47390010347adc5c2cbaefb056741e8b9a7bd057e258ccf8f36ef9af75fbce'
AND (
token = 'euGXGoX7/58isZ8FLGYQY8jwFeLs5GKSMoZqsVPpEjo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)