UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hEs5jQ195ZJmLK1m5u6jOCa7BdBsGJixh4f0kVUCqjE='
WHERE
key_id = '6e3b07a886ec992ce5b813a6a12d5af591b8441f50c16a1b3c10f9cc3daabfd2'
AND (
token = 'hEs5jQ195ZJmLK1m5u6jOCa7BdBsGJixh4f0kVUCqjE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)