UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9LRF1t80rUKrioDpzHipssKKBTwgsmtYJFMlwWZ2MPc=' 
WHERE 
  key_id = '06dac6dcc3e26bc652cfe033d400d7bdeccd8167176cb58b82f6b56c18265a86' 
  AND (
    token = '9LRF1t80rUKrioDpzHipssKKBTwgsmtYJFMlwWZ2MPc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031