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