UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hFtaOWTFI3KXPMXcaKsOste3KlworDctzFuINBKfAzI='
WHERE
key_id = 'e778d2aa7a12f77ef2879bd0f5b28409d0f8c170778a579e81023c270dd15962'
AND (
token = 'hFtaOWTFI3KXPMXcaKsOste3KlworDctzFuINBKfAzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)