UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '92Zul7BGg3/g4XtXYtsEzekwnQBwdaQagYwxC6QUQ8w='
WHERE
key_id = '6309bfd039b795d60fb2ab9c1693b8e6d5e325cdff9861a56ac3f7bf55e245f9'
AND (
token = '92Zul7BGg3/g4XtXYtsEzekwnQBwdaQagYwxC6QUQ8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)