UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kCkGpv3DNAOtSzDM7nvQBGPXX9b6bHhsgkaKAoIrJoE='
WHERE
key_id = '69253d432f5f44d1a43c2f91e17d4a33b9ff618c276ba72e43e8cce698103f97'
AND (
token = 'kCkGpv3DNAOtSzDM7nvQBGPXX9b6bHhsgkaKAoIrJoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)