UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w8iEgEl96vG/yCbClcWWUTfpjO3Hjny3N836gs3HT4w='
WHERE
key_id = 'f4f3fc1cadd42738e481ffabdb743ae9cb129c6e6b3677d18d546a0ca53fbc71'
AND (
token = 'w8iEgEl96vG/yCbClcWWUTfpjO3Hjny3N836gs3HT4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)