UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j2E2IDHVJ3F24PfNF4nZ9UysjbnEnzag5xuRwt48gcs='
WHERE
key_id = '719b97c98ec371869564a9479d68b2a43adb8ad2d5d2defb2fcbd987d88a3bdd'
AND (
token = 'j2E2IDHVJ3F24PfNF4nZ9UysjbnEnzag5xuRwt48gcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)