UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/1stnYU2gtuetJI5MneXoNtzpzL4npF8ifHdk7DKT1A=' 
WHERE 
  key_id = '7a0e6f7eb21bbd1c6855bc8622115f1ab3414938da75e974a4a74d580463fb04' 
  AND (
    token = '/1stnYU2gtuetJI5MneXoNtzpzL4npF8ifHdk7DKT1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032