UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pntvKBCS/+NUNI7oOLKB3Gn00Oabxj0wxXarSCCY3o0='
WHERE
key_id = 'b3a8f84dd8ba9ee685b376c1fff32472e18a75afa91cc20a236888da9c963a7f'
AND (
token = 'pntvKBCS/+NUNI7oOLKB3Gn00Oabxj0wxXarSCCY3o0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)