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