UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mRNqYldEd3Rb1zpYRDdhW7Z2hVArLjQuyh0t8bVTi5k=' 
WHERE 
  key_id = 'ba7476c0dd943312d0657bc8822a6bc53f814d89bd0f786f5f52a83f3155c49a' 
  AND (
    token = 'mRNqYldEd3Rb1zpYRDdhW7Z2hVArLjQuyh0t8bVTi5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052