UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RPoaq9hrR4TrlSYcnXAj2WUfPYtzh9XZgWFw6MSaFos='
WHERE
key_id = '3c38bbc1b2110d6e2de2547fe6bc67806674f9b4f64a5e041105bd84f1d8faf0'
AND (
token = 'RPoaq9hrR4TrlSYcnXAj2WUfPYtzh9XZgWFw6MSaFos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)