UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cNfLJkbGzCQ/MdgdCZ8VqLMw5JYBSE5L18VQ3heLXd8='
WHERE
key_id = '5b8712addb7a2c318780deffdcd761ce63f8d371250bd0109f8afe74519726b5'
AND (
token = 'cNfLJkbGzCQ/MdgdCZ8VqLMw5JYBSE5L18VQ3heLXd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)