UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ta3fRK1PIOCVz5vFfiY9msrw/ITwwA0xYZv72yGao8A=' 
WHERE 
  key_id = 'd36f4af75ee4078e9dc33062c484300e8a7e23d7ff54e4534e4ee5f7b41aa4eb' 
  AND (
    token = 'Ta3fRK1PIOCVz5vFfiY9msrw/ITwwA0xYZv72yGao8A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035