UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nE7rQVPOnJdZFvCin4kwKSfmPEWRkZm22CbVF9w6rPg='
WHERE
key_id = '2d5153ea296d3ac8524eb395b19f37b998f9e8ed8f3fbb95116cef1ff157354e'
AND (
token = 'nE7rQVPOnJdZFvCin4kwKSfmPEWRkZm22CbVF9w6rPg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)