UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vrnSwNrBqIWw08NtuFcEs8+/DsDBUkby/57lKZvFRIs=' 
WHERE 
  key_id = '070be53e0b1138c755ff0ed280a6ec0e15d1e8e80a07f4a0dbd5632ead6926f5' 
  AND (
    token = 'vrnSwNrBqIWw08NtuFcEs8+/DsDBUkby/57lKZvFRIs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019