UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GPP34c0wcKXEsbNHQVEYlh4RUu4OGMLBAuOPbOu3UJ4=' 
WHERE 
  key_id = '6562e3e28c918aef67cc67f52e2f334d37809eb32a0e0f6643df432ba48409bf' 
  AND (
    token = 'GPP34c0wcKXEsbNHQVEYlh4RUu4OGMLBAuOPbOu3UJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033