UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6kVJ2Vd713L+i7bGoIvpYjLudLCdGC2N4WUrVSEmE4U='
WHERE
key_id = '2d5c56821d16893a34ecc59d2f2d6952afa3e6e21342baece2b22feacf5e5b17'
AND (
token = '6kVJ2Vd713L+i7bGoIvpYjLudLCdGC2N4WUrVSEmE4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)