UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pkt3ZohLrBYcoJLCnwaXl3uYtBpWpVxoKr4PKL7zlzk='
WHERE
key_id = '66c0a2f75b0d4ce3fe897150c62231a659aab54de3be528a50fecd4b43b0b5db'
AND (
token = 'Pkt3ZohLrBYcoJLCnwaXl3uYtBpWpVxoKr4PKL7zlzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)