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