UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g+yvxojWDGzVu2v2BoCXscLE8FapWqezU4w7ThjBUNA='
WHERE
key_id = 'cfa2669d61170c70a75456c3c2ca98b60d4d29fb92d0622c808b5b0dfeda6016'
AND (
token = 'g+yvxojWDGzVu2v2BoCXscLE8FapWqezU4w7ThjBUNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)