UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rBJnuTrjw9Q6PZepTu/3+mSv2vxWJDqXgEgtNEll9cA='
WHERE
key_id = '84322ad3ee925e42a39673007936cccd0794c74304eb0f8c6f5b66ed3a9ad9fe'
AND (
token = 'rBJnuTrjw9Q6PZepTu/3+mSv2vxWJDqXgEgtNEll9cA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)