UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bn/OvVUvDzLBPaiaDlMUZH97GwnFwjBXFAzGp/7Kmgo='
WHERE
key_id = 'a7b798a4fe625a7b460c6193a68e41d04b8b22dded43a3d232db088f1d9def9e'
AND (
token = 'bn/OvVUvDzLBPaiaDlMUZH97GwnFwjBXFAzGp/7Kmgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)