UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FY3idD40WNmb2PZp5nCKKRczsPvm6HOgalf7BvTatPg=' 
WHERE 
  key_id = '62491cc608f64be97b7c7faa4303b400a0d80fe5fbd2a806592fccea64022d46' 
  AND (
    token = 'FY3idD40WNmb2PZp5nCKKRczsPvm6HOgalf7BvTatPg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033