UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E8ptab9L8JpQTsLN1Roz47GBI9kI6YvwMLtAqadzqMI=' 
WHERE 
  key_id = '185d0adfc8de8acee4afad95897d703d619581c1d26c312340f904407f9a2b57' 
  AND (
    token = 'E8ptab9L8JpQTsLN1Roz47GBI9kI6YvwMLtAqadzqMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026