UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Nqxa+X9gPbyq/JoNIVRxuRvzR8aXM9KPMzJB6Xs+kE=' 
WHERE 
  key_id = '700b6cedc08b8f77c12b9ea239002c9c00213c4774b696dec671ebeba645e3c5' 
  AND (
    token = '1Nqxa+X9gPbyq/JoNIVRxuRvzR8aXM9KPMzJB6Xs+kE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037